1. Field of the Invention
The present invention relates to the manipulation of objects displayed on a display screen, and more particularly to a method and apparatus for positioning objects using direct manipulation.
2. Background Art
FIG. 1 shows an example of two objects, object A 100 and object B 105, displayed on a display device such as a computer display screen. The objects may, for example, be objects created with a graphics editing program. Objects such as object A 100 and object B 105 that are displayed on a display screen may be referred to as “screen objects.” The screen objects shown in FIG. 1 are simple rectangles. However, screen objects can have any size and shape. Further, a screen object may consist of a group of different objects. For example, a screen object may comprise a bit-mapped image combined with a vector-based drawing object. A screen object may also represent other objects or data, such as, for example, a sound clip or video data.
A user often desires to manipulate screen objects such that they are precisely located or precisely dimensioned with respect to other objects on the screen. For example, a user may desire to position an object such that one or more of its edges coincide with one or more edges of another object, as shown in FIG. 2, or such that one or more of its edges are positioned close to but spaced apart from another object, as shown in FIG. 3. A user may also wish to resize an object such that the object has the same height and/or width as another object, as shown in FIG. 4.
A number of approaches to the precision location and precision sizing of screen objects have been developed in the prior art.
One approach, used in drawing programs such as MacDraw (tm) and Claris Works (tm), is to provide precision-location and precision-sizing commands. To use these commands, a user must first select the objects in question, for example by positioning a cursor over each object and clicking a mouse button. Next, the user must invoke the desired command, for example by hitting an appropriate hot key or key combination on a keyboard or by selecting the command using pull-down menus. Finally, the user must enter information regarding the manner in which the user wants to position or resize the object into a dialog box that opens after the command is activated. FIG. 5 shows an example dialog box for the “align” menu command from MacDraw(tm).
Although using precision location and precision sizing commands allows the user to position or size objects, the multiple steps required to use these commands are inconvenient.
A second approach uses a technique sometimes referred to as “gravity.” In this approach an object, around its edges, is provided with a “region of influence” that exerts a pull on other objects that come into the region. FIGS. 6-9 illustrate the operation of the prior art gravity technique. In FIG. 6, a dotted rectangle 600 indicates the region of influence for the left edge of object B 105. FIG. 6 also shows a mouse cursor 605 positioned over object A 100. A user may move object A 100 by selecting and “dragging” object A 100 with a mouse.
In the gravity approach, when a first object (such as object A 100) is dragged so that one of its edges enters the region of influence of an edge of a second object (such as object B 105), the first object is automatically “snapped” to the second object such that the edges of the two objects meet. FIG. 7 shows object A 100 after it has been moved horizontally to the right such that its right edge enters region of influence 600 of object B 105. Once the right edge of object A 100 enters region of influence 600, object A 100 is snapped to the right such that its right edge is aligned with the left edge of object B 105, as shown in FIG. 8. In this prior art example, if mouse cursor 605 is dragged far enough further to the right, object A 100 once again becomes “unstuck” from object B 105, as shown in FIG. 9.
Although the gravity technique of the prior art is useful when a user wants to align objects such that their edges coincide, it prevents the user from arbitrarily positioning objects close to one another. As soon as an edge of a first object enters a second object's region of influence, the first object is snapped into alignment with the second object. Prior art gravity systems thus provide for easy alignment, but at the cost of preventing arbitrary positioning of objects close to one another.